package com.yunji.base.service;

import com.yunji.base.bo.ManagerSiteSelectBO;
import com.yunji.base.dao.IManagerSiteDao;
import com.yunji.base.domain.ManagerSiteDO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * @version 1.0
 * @Project: yunji-coffee
 * @Package com.yunji.user.service.impl
 * @FileName ManagerSiteServiceImpl.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @CreateTime 2024-05-30 13:44:11
 * @Description 经理网点服务接口实现
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo0803@163.com	2024-05-30 13:44:11		1.0					1.0 Version
 * @since JDK 1.8.0_202
 */
@Service
public class ManagerSiteService {
    @Resource
    IManagerSiteDao managerSiteDao;

    /**
     * @param site 经理网点绑定信息
     * @Title create
     * @Desc 创建经理网点绑定关系
     * @Date 2024-05-30 17:21:48.645
     * @Return boolean 创建结果
     */

    public boolean create(ManagerSiteDO site) {
        return managerSiteDao.save(site);
    }

    /**
     * @param site 经理网点绑定信息
     * @Title update
     * @Desc 更新经理网点绑定关系
     * @Date 2024-05-30 17:22:01.214
     * @Return boolean 更新结果
     */

    public boolean update(ManagerSiteDO site) {
        return managerSiteDao.updateById(site);
    }

    /**
     * @param ids 绑定关系ID数组
     * @Title delete
     * @Desc 更新经理网点绑定关系
     * @Date 2024-05-30 17:22:04.429
     * @Return boolean 删除结果
     */

    public boolean delete(Long... ids) {
        return managerSiteDao.removeBatchByIds(Arrays.asList(ids));
    }

    /**
     * @Title deleteBySiteId
     * @Desc 删除经理网点绑定关系
     * @Date 2024-05-30 17:22:07.056
     * @Return boolean 删除结果
     */

    public boolean deleteBySiteId(Long... siteIds) {
        return managerSiteDao.removeBatchBySiteIds(Arrays.asList(siteIds));
    }

    /**
     * @param siteId 网点ID
     * @Title select
     * @Desc 查找网点信息
     * @Date 2024-06-01 15:47:29.680
     * @Return ManagerSite 网点信息
     */

    public ManagerSiteDO getBySiteId(Long siteId) {
        return managerSiteDao.getBySiteId(siteId);
    }

    /**
     * @Title selectBySiteId
     * @Desc 根据网点ID获取经理网点绑定关系
     * @Date 2024-06-01 16:55:45.381
     * @Return List<ManagerSite> 经理网点绑定关系
     */

    public List<ManagerSiteDO> selectBySiteId(Long... siteIds) {
        return managerSiteDao.listBySiteIds(Arrays.asList(siteIds));
    }

    public ManagerSiteDO select(ManagerSiteSelectBO bo) {
        return managerSiteDao.ManagerSiteSelectBO(bo);
    }

    /**
     * @Title selectByUserId
     * @Desc 根据用户ID获取经理网点绑定关系
     * @Date 2024-06-01 16:59:11.197
     * @Return List<ManagerSite> 经理网点绑定关系
     */
    public List<ManagerSiteDO> selectByUserId(Long... userIds) {
        return managerSiteDao.listByUserIds(Arrays.asList(userIds));
    }


}